package com.franklions.nacos.example.config;

import com.alibaba.nacos.api.config.ConfigType;
import com.alibaba.nacos.api.config.annotation.NacosConfigurationProperties;
import com.alibaba.nacos.api.config.annotation.NacosIgnore;
import com.alibaba.nacos.api.config.annotation.NacosProperty;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

import java.util.List;
import java.util.Map;

/**
 * @author flsh
 * @version 1.0
 * @date 2023/3/13
 * @since Jdk 1.8
 */
@Data
@Configuration
@NacosConfigurationProperties(prefix = "myapp", dataId = "nacos-example-app", groupId = "DEFAULT_GROUP", autoRefreshed = true, ignoreNestedProperties = true, type = ConfigType.YAML)
public class AppConfigProperties {
    private int id;
    private String name;
    private double value;
    @NacosIgnore
    private Integer intData;
    @NacosProperty("float-data")
    private Float floatData;
    private List<Integer> list;
    private Map<String, String> map;
}
